=== (Identity)

The Identity operator is used to dtermine whter the two operands are equal, or not. If the left operand is equal to the right operand, a result of true is returned. If the left operand is not equal to the right operand, a result of false is returned. It should be noted that there is no data type conversion given to either operand before the expression is evaluated. With this in mind, make sure you don't mix numeric values and strings, which is a common blunder. For example, the Number 50 and the string "50" (note the quotes) aren't the same in the eyes of the JavaScript parser.

syntax:

numberOne === numberTwo

EXAMPLE

var variableOne = new String("100");

if (variableOne === 100) {

document.write("The values are the same");

} else {

document.write("The values aren't the same") }

In this example, the variable has been loaded with the string "100". It is then used in the condition area of an if / else statement. Since the two data types aren't the same (the string "100" isn't the same as the Number 100), the document.write satement returned will be "The values aren't the same".